package org.bite.five_notes.Component;

import org.bite.five_notes.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserComponent {
    public void sayHi(){
        System.out.println("Hi,UserComponent...");
    }
    @Bean({"h1","h2","h3"})

    public UserInfo UserInfo(){
        return new UserInfo(1,"myname is X");
    }
    @Bean

    public UserInfo UserInfo2(){
        return new UserInfo(2,"myname is Y");
    }
    @Bean
//    @Primary
    public UserInfo UserInfo3(){
        return new UserInfo(3,"myname is M");
    }
}
